/*  1:   */ package com.rinsi.core.interceptor;
/*  2:   */ 
/*  3:   */ import com.rinsi.core.CoreCache;
/*  4:   */ import com.rinsi.util.AssertUtil;
/*  5:   */ import com.rinsi.util.ListUtil;
/*  6:   */ import com.rinsi.util.MapUtil;
/*  7:   */ import java.util.List;
/*  8:   */ import java.util.Map;
/*  9:   */ import javax.servlet.http.HttpServletRequest;
/* 10:   */ import javax.servlet.http.HttpServletResponse;
/* 11:   */ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
/* 12:   */ 
/* 13:   */ public class CacheInterceptor
/* 14:   */   extends HandlerInterceptorAdapter
/* 15:   */ {
/* 16:   */   public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
/* 17:   */     throws Exception
/* 18:   */   {
/* 19:24 */     Map<String, Object> params = MapUtil.createParamsMap(request);
/* 20:29 */     if (AssertUtil.isStringNotEmpty(MapUtil.getString(params, "UID")))
/* 21:   */     {
/* 22:31 */       String uid = MapUtil.getString(params, "UID");
/* 23:33 */       if (AssertUtil.isStringNotEmpty(MapUtil.getString(params, "MODULE_NO")))
/* 24:   */       {
/* 25:35 */         String mno = MapUtil.getString(params, "MODULE_NO");
/* 26:   */         
/* 27:37 */         List<Map<String, Object>> modules = CoreCache.getCacheList(uid, "modules");
/* 28:   */         
/* 29:39 */         Map<String, Object> module = (Map)ListUtil.subList(modules, "MODULE_NO='" + mno + "'").get(0);
/* 30:   */         
/* 31:41 */         CoreCache.cache(uid, "module", module);
/* 32:   */       }
/* 33:   */     }
/* 34:46 */     return super.preHandle(request, response, handler);
/* 35:   */   }
/* 36:   */ }


/* Location:           D:\Users\Desktop\shanxi\项目\sxazmis\WEB-INF\classes\
 * Qualified Name:     com.rinsi.core.interceptor.CacheInterceptor
 * JD-Core Version:    0.7.0.1
 */